<!-- 科目三加练 -->
<template>
	<view class="page_box">
		<cu-custom :isBack="true" bgColor="bg-white">
			<block slot="content"><text class="text-bold">整车操作</text></block>
		</cu-custom>
		<view class="content_box">
			<scroll-view scroll-y="true" enable-back-to-top @scrolltolower="loadMore" class="scroll-box">
				<view class="list" v-for="(item, index) in list" :key="item.id">
					<view class="order-item">
						<text>车号：{{ item.cheh }}</text>
					</view>
					<view class="order-item">

						<text>路线：{{item.luxian}}</text>
					</view>
					<view class="order-item list-border">
						<text>安全员：{{ item.anqy}}</text>
					</view>
					<view class="order-bottom x-bc">
						<view class="all-msg"></view>
						<view class="btn-box">
							<button v-if="type==0" @tap.stop="onPlay(item.id)" class="cu-btn obtn2 bg-blue">整车核销</button>
							<button v-else @tap.stop="onPlay(item.id)" class="cu-btn obtn2 bg-blue">整车结束</button>
						</view>
					</view>
				</view>



			</scroll-view>
		</view>
	</view>
</template>

<script>
	export default {
		components: {},
		data() {
			return {
				// 整车数据
				list: [],
				carId: '',
				type:0


			};
		},
		onLoad(option) {
			if (option.type && option.type != '') {
				this.type = option.type;
			}
			// 获取车辆的id
			if (option.id && option.id != '') {
				this.carId = option.id;
				this.onLoadData()
			}
			
		},
		methods: {
			onLoadData() {
				// uni.request({
				// 	url: '',
				// 	data: {
				// 		carId: this.carId,
				// 	},
				// 	method: 'POST',
				// 	success: (res) => {

				// 	},
				// 	fail: (err) => {

				// 	}
				// });
				this.list = [{

						id: 0,
						cheh: '01',
						luxian: '1号线',
						anqy: '张无忌'
					},
					{

						id: 1,
						cheh: '02',
						luxian: '1号线',
						anqy: '张无忌'
					},
				]
			},
			// 加载更多
			loadMore() {

			},
		}
	};
</script>

<style lang="less">
	.page_box {}

	.w50 {
		width: 50%;
	}

	.cu-form-group uni-picker .picker {
		text-align: left;
	}

	.content_box {
		padding: 0 20rpx;
	}

	.list {
		background: #fff;
		margin: 20rpx 0;
		border-radius: 10rpx;
		padding-top: 25rpx;

		.order-bottom {
			padding-top: 20rpx;
			padding-bottom: 20rpx;

			.btn-box {
				justify-content: flex-end;
			}

			.obtn1 {
				width: 160rpx;
				height: 60rpx;
				background: #fff;
				border-radius: 30rpx;
				border: 2rpx solid #ddd;
				font-size: 26rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: rgba(51, 51, 51, 1);
				margin-right: 20rpx;
				padding: 0;
			}

			.obtn2 {
				width: 160rpx;
				height: 60rpx;

				border-radius: 30rpx;
				margin-right: 20rpx;
				font-size: 26rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: #fff;
				padding: 0;
			}
		}

		.order-head {
			padding: 0 25rpx 25rpx;
			// height: 50rpx;
			border-bottom: 1rpx solid #dfdfdf;
		}

		.order-item {
			padding: 0 25rpx 25rpx;
			// height: 50rpx;
		}

		.order-content {
			padding: 20rpx 20rpx 0;
		}

		.list-border {
			border-bottom: 1rpx solid #dfdfdf;


		}

		.goods-bottom {
			background: #fff;
			padding-bottom: 30rpx;
		}
	}
</style>
